/* 灌溉管理页面容器 */
.irrigation-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
}

/* 左侧信息栏 */
.irrigation-sidebar {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* 土壤墒情卡片 */
.soil-moisture-gauge {
    text-align: center;
    padding: 1.5rem 0;
}

.gauge-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.gauge-label {
    color: #666;
    font-size: 0.9rem;
}

.moisture-details {
    margin-top: 1.5rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 1px solid #eee;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item .label {
    color: #666;
}

.detail-item .value {
    font-weight: 500;
    color: #2c3e50;
}

/* 灌溉控制面板 */
.control-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.control-group {
    background: #f8f9fa;
    padding: 1.2rem;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.05);
}

.control-group h3 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-group h3 i {
    color: #3498db;
}

/* 开关按钮样式 */
.switch-button {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch-button input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .switch-slider {
    background-color: #2ecc71;
}

input:checked + .switch-slider:before {
    transform: translateX(26px);
}

/* 滑块控制样式 */
.slider-control {
    margin-top: 1rem;
}

.slider-control label {
    display: block;
    margin-bottom: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

.range-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #ddd;
    outline: none;
    margin: 1rem 0;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    transition: all 0.3s ease;
}

.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.slider-value {
    text-align: right;
    color: #3498db;
    font-weight: 600;
}

/* 主要内容区 */
.irrigation-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* 左侧主面板 */
.main-panel {
    flex: 1;
    min-width: 0; /* 防止flex子项溢出 */
}

/* 右侧预警面板 */
.alert-panel {
    width: 360px; /* 稍微加宽以便更好地显示内容 */
    flex-shrink: 0;
}

.alert-panel .alert-section {
    position: sticky;
    top: 1rem;
    margin-bottom: 0;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 预警分类标签 */
.alert-category {
    margin: 1rem 0;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-left: 4px solid #4CAF50;
    font-weight: 500;
    color: #2c3e50;
}

.alert-category.moisture {
    border-left-color: #2196F3;
}

.alert-category.device {
    border-left-color: #FF9800;
}

.alert-category.quality {
    border-left-color: #4CAF50;
}

/* 预警项样式优化 */
.alert-item {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    transition: all 0.3s ease;
}

.alert-item:hover {
    background-color: #f8f9fa;
}

.alert-item .alert-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
}

.alert-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.8rem;
    font-size: 1.2rem;
}

.alert-title {
    flex: 1;
    font-weight: 500;
    color: #2c3e50;
}

.alert-time {
    font-size: 0.85rem;
    color: #666;
    margin-left: auto;
}

.alert-message {
    margin: 0.5rem 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* 预警等级样式 */
.alert-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-right: 0.5rem;
}

.alert-badge.high {
    background-color: #ffebee;
    color: #d32f2f;
}

.alert-badge.medium {
    background-color: #fff3e0;
    color: #f57c00;
}

.alert-badge.low {
    background-color: #e8f5e9;
    color: #388e3c;
}

/* 预警操作按钮优化 */
.alert-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: 0.8rem;
}

.btn-alert {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

/* 预警统计样式优化 */
.alert-summary {
    padding: 1rem;
    background: #fff;
    border-top: 1px solid #eee;
    position: sticky;
    bottom: 0;
}

.summary-item {
    text-align: center;
    padding: 0.5rem;
}

.summary-label {
    font-size: 0.85rem;
    color: #666;
}

.summary-value {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2c3e50;
    margin-top: 0.3rem;
}

/* 状态卡片 */
.status-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.status-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.status-card:hover {
    transform: translateY(-5px);
}

.status-card h4 {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.status-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-value i {
    font-size: 1.2rem;
}

/* 图表区域 */
.chart-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* 智能预警面板样式 */
.alert-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.alert-controls {
    display: flex;
    gap: 1rem;
}

.alert-controls select {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    font-size: 0.9rem;
    cursor: pointer;
}

.alert-container {
    margin-top: 1rem;
}

.alert-list {
    max-height: 300px;
    overflow-y: auto;
}

/* 灌溉计划表格 */
.schedule-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.btn-add {
    padding: 0.5rem 1rem;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-add:hover {
    background: #43A047;
}

.schedule-table {
    overflow-x: auto;
}

.schedule-table table {
    width: 100%;
    border-collapse: collapse;
}

.schedule-table th,
.schedule-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.schedule-table th {
    background: #f8f9fa;
    color: #666;
    font-weight: 500;
}

.schedule-table tr:hover {
    background: #f8f9fa;
}

/* 统计面板样式 */
.statistics-panel {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.statistics-list {
    margin-top: 1rem;
}

.statistic-item {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 1px solid #eee;
}

.statistic-item:last-child {
    border-bottom: none;
}

.statistic-item .label {
    color: #666;
}

.statistic-item .value {
    font-weight: 500;
    color: #2c3e50;
}

/* 分析指标样式 */
.analysis-metrics {
    display: flex;
    justify-content: space-around;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 1rem;
}

.metric-item {
    text-align: center;
}

.metric-label {
    display: block;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 1.2rem;
    font-weight: 500;
    color: #2c3e50;
}

/* 图表控件样式优化 */
.chart-controls {
    display: flex;
    gap: 1rem;
}

.chart-controls select {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    font-size: 0.9rem;
    cursor: pointer;
}

.chart-controls select:focus {
    outline: none;
    border-color: #4CAF50;
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .status-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .irrigation-container {
        grid-template-columns: 1fr;
    }
    
    .irrigation-sidebar {
        order: 2;
    }
    
    .control-panel {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .control-panel {
        grid-template-columns: 1fr;
    }
    
    .records-table {
        display: block;
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .status-cards {
        grid-template-columns: 1fr;
    }
    
    .irrigation-container {
        padding: 1rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.irrigation-container {
    animation: fadeIn 0.5s ease-out;
}

/* 灌溉记录表格 */
.irrigation-records {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.records-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.records-header h3 {
    color: #2c3e50;
    font-size: 1.2rem;
}

.records-table {
    width: 100%;
    border-collapse: collapse;
}

.records-table th,
.records-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.records-table th {
    background: #f8f9fa;
    color: #2c3e50;
    font-weight: 500;
}

.records-table tbody tr:hover {
    background: #f8f9fa;
}

.status-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.status-badge.active {
    background: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
}

.status-badge.inactive {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
} 